# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: B2901BL_App.py
  @time: 2022/2/22 17:47
  @desc:
"""

from ATS.instrumentDriver.InstGenSMU.InstGenSMU_B2901BL import SMU_B2901BL


class B2901BLApp:
    def __init__(self, name):
        self.b2901b = SMU_B2901BL(name)

    def sweep_setting(self, start_v, stop_v, point_v, compliance):
        self.b2901b.set_sweep_init(start_v, stop_v, point_v, compliance)

    def spot_setting(self, voltage, compliance, channel=1):
        self.b2901b.set_spot_setting(voltage, compliance, channel)

    def set_voltage(self, voltage, channel=1):
        self.b2901b.set_voltage(voltage, channel)

    def output_close(self, channel=1):
        self.b2901b.output_close(channel)

    def biasv_init(self):
        self.b2901b.set_biasv_init()

    def measure(self, channel):
        data = self.b2901b.measure(channel)
        return data

    def get_current(self):
        return self.b2901b.get_current()


    def trigger_measure(self):
        return self.b2901b.trigger_measurement()
